<<<<<<< HEAD
<?php
    if(!empty($_POST['sel'])){
        $sel=$_POST['sel'];
    }else{
        $sel="";
    }
?>


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .red{
            color:red;
        }
        .black{
            color:black;
        }
        .green{
            color:green;
        }
        .yellow{
            color:yellow;
        }
    </style>
</head>
<body>
    <form action="" method="post">
        <p class="<?php echo $sel ?>">悯农二首·其二 <br>
            李绅 〔唐代〕
        锄禾日当午，汗滴禾下土。
        谁知盘中餐，粒粒皆辛苦？</p>
        <select name="sel" id="">
            <option value="red">红色</option>
            <option value="black">黑色</option>
            <option value="green">绿色</option>
            <option value="yellow">黄色</option>
        </select>
        <input type="submit" value="改变颜色"> 
    </form>
</body>
</html>

=======
<?php
    if(!empty($_POST['sel'])){
        $sel=$_POST['sel'];
    }else{
        $sel="";
    }
?>


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .red{
            color:red;
        }
        .black{
            color:black;
        }
        .green{
            color:green;
        }
        .yellow{
            color:yellow;
        }
    </style>
</head>
<body>
    <form action="" method="post">
        <p class="<?php echo $sel ?>">悯农二首·其二 <br>
            李绅 〔唐代〕
        锄禾日当午，汗滴禾下土。
        谁知盘中餐，粒粒皆辛苦？</p>
        <select name="sel" id="">
            <option value="red">红色</option>
            <option value="black">黑色</option>
            <option value="green">绿色</option>
            <option value="yellow">黄色</option>
        </select>
        <input type="submit" value="改变颜色"> 
    </form>
</body>
</html>

>>>>>>> 729bf69 (1)
